package com.mszlu.blog.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mszlu.blog.admin.pojo.Admin;
import com.mszlu.blog.admin.pojo.Permission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AdminMapper extends BaseMapper<Admin> {

    @Select("SELECT  mp.* FROM `ms_permission` mp JOIN `ms_admin_permission` map ON  mp.`id`=map.`permission_id` WHERE map.`admin_id`=#{id}")
    List<Permission> findPermissionByAdminId(Long id);

}
